package com.spring.aop.AspectJ;



import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/*
 * AOP AspectJ
 * 
 * 
 * 
 * 与之前相比较，通过注解减少代码开发
 * 
 * 
 */



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class ProductDaoImplTest {

	@Resource(name="productDao")
	private ProductDao productDao;
	
	@Test
	public void test() {
		
	/*	
		ApplicationContext  applicationContext=new  ClassPathXmlApplicationContext("applicationContext.xml");
	   ProductDao  bean = (ProductDao) applicationContext.getBean("productDao");
		*/
	
		productDao.save();
		productDao.update();
		productDao.deleta();
		productDao.find();
	}

}
